package com.i2863.receipt.dao;

import com.i2863.receipt.entity.Site;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * Created by Administrator on 2018/6/8.
 */
public interface SiteRepository extends JpaRepository<Site,Integer>,JpaSpecificationExecutor<Site>{

    @Modifying
    @Query(value = "update d_site set img_url = :imgUrl,modifyDate = now() where id = :siteId",nativeQuery = true)
    void updateImg(@Param("imgUrl")String imgUrl, @Param("siteId")Integer sitId);


}
